let db = require("../../db/db")

let service = {
    getdatasources: function () {
        return [
            {
                label: "测试数据源",
                name: "test"
            }
        ]
    },
    getcolumns: function (datasource) {
        return []
    },
    getfilterfields: function (datasource) {
        return [
            {
                label: "ID",
                name: "id",
                type: "text",
                operators: ['equal', 'like']
            },
            {
                label: "名称",
                name: "name",
                type: "text",
                operators: ['equal', 'like']
            }
        ]
    },
    getdata: function (datasource, filter) {
        return {
            count: 2,
            rows: [
                {
                    id: "1",
                    name: "名称1"
                },
                {
                    id: "2",
                    name: "名称2"
                }
            ],
            columns: [
                {
                    label: "ID",
                    name: "id"
                },
                {
                    label: "名称",
                    name: "name"
                }
            ]
        }
    }
}

module.exports = { service }